package tmt.usercenter.web.service;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tmt.usercenter.web.domain.AuthScope;
import tmt.usercenter.web.repository.IAuthScopeRepo;

import java.util.Collections;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class AuthScopeService extends TmtBaseService<AuthScope, Long> {

	@Getter
	private IAuthScopeRepo authScopeRepo;

	@Autowired
	public AuthScopeService(IAuthScopeRepo authScopeRepo) {
		super(authScopeRepo, Collections.emptyList());
		this.authScopeRepo = authScopeRepo;
	}

	@Transactional(readOnly = true)
	public List<AuthScope> findAllBySystemScope(boolean systemScope) {
		return authScopeRepo.findAllBySystemScope(systemScope);
	}

}
